package flc.ast.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.MyDrawBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class ImitationAdapter extends StkProviderMultiAdapter<MyDrawBean> {

    public ImitationAdapter() {
        addItemProvider(new StkSingleSpanProvider<>(35));
        addItemProvider(new ImitationProvider());
    }

    private class ImitationProvider extends BaseItemProvider<MyDrawBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_imitation;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, MyDrawBean bean) {
            baseViewHolder.setImageResource(R.id.ivImitationItemSmallImg, bean.getSmallImg());
            baseViewHolder.setImageResource(R.id.ivImitationItemBigImg, bean.getBigImg());
        }
    }
}
